package edu.cmu.cs.stage3.alice.core.question.list;

import edu.cmu.cs.stage3.alice.core.property.NumberProperty;
import edu.cmu.cs.stage3.alice.core.property.ObjectProperty;

public class FirstIndexOfItem extends ListNumberQuestion {
	public final ObjectProperty item = new ObjectProperty( this, "item", null, Object.class );
	public final NumberProperty startFromIndex = new NumberProperty( this, "startFromIndex", null );
	private static Class[] s_supportedCoercionClasses = { LastIndexOfItem.class };
	//Rem @Override
	public Class[] getSupportedCoercionClasses() {
		return s_supportedCoercionClasses;
	}
	//Rem @Override
	protected int getValue( edu.cmu.cs.stage3.alice.core.List listValue ) {
		return listValue.firstIndexOfItemValue( item.getValue(), startFromIndex.intValue( 0 ) );
	}
}